<template>
	<view class="page">
		<view class="flex benben-position-layout flex flex-wrap align-center personalInformation_flex_0"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex flex-wrap align-center justify-between flex-sub personalInformation_fd0_0'>
				<view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
					<text class='fu-iconfont2  personalInformation_fd0_0_c0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">&#xE794;</text>
				</view>
				<text class='personalInformation_fd0_0_c1'>车辆详情</text>
				<view class='flex flex-wrap align-center personalInformation_fd0_0_c2'>
				</view>
			</view>

		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		<view class="loading_css" v-if="isShow">
			<u-loading size="36" color="#1A66FA"></u-loading>
			<view>加载中</view>
		</view>
		<template v-else>
			<view class="page_content">
				<view class="content_info">
					<view class="content_title flex align-center justify-between">
						<view class="title_le">基本信息</view>
						<view class="title_ri" @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/index/vehicle/improveInformation?id=${id}`">
							<text>完善信息</text>
							<u-icon name="arrow-right" size="24"></u-icon>
						</view>
					</view>
					<view class="item_info flex align-center justify-between">
						<view class="item_info_le">车牌号</view>
						<view class="item_info_ri">{{detailsInfo.car_number}}</view>
					</view>
					<view class="item_info flex align-center justify-between">
						<view class="item_info_le">品牌车系</view>
						<view class="item_info_ri">{{detailsInfo.brand_name}}</view>
					</view>
					<view class="item_info flex align-center justify-between">
						<view class="item_info_le">车身颜色</view>
						<view class="item_info_ri">{{detailsInfo.color}}</view>
					</view>
					<view class="item_info flex align-center justify-between">
						<view class="item_info_le">发动机号</view>
						<view class="item_info_ri">{{detailsInfo.engine_no}}</view>
					</view>
					<view class="item_info flex align-center justify-between">
						<view class="item_info_le">车架号</view>
						<view class="item_info_ri">{{detailsInfo.carframe}}</view>
					</view>
					<view class="item_info flex align-center justify-between">
						<view class="item_info_le">注册时间</view>
						<view class="item_info_ri">{{detailsInfo.register_time}}</view>
					</view>
					<view class="item_info flex align-center justify-between no_line">
						<view class="item_info_le">保险电话</view>
						<view class="flex align-center" @tap.stop="getgiveMobile">
							<view class="item_info_ri">{{detailsInfo.insure_phone}}</view>
							<image :src='STATIC_URL+"452.png"' mode=""></image>
						</view>
					</view>
					<!-- <view class="item_info flex align-center justify-between">
						<view class="item_info_le">当前里程</view>
						<view class="item_info_ri">-</view>
					</view>
					<view class="item_info flex align-center justify-between">
						<view class="item_info_le">保险到期时间</view>
						<view class="item_info_ri">-</view>
					</view>
					<view class="item_info flex align-center justify-between">
						<view class="item_info_le">保养到期时间</view>
						<view class="item_info_ri">-</view>
					</view>
					<view class="item_info no_line flex align-center justify-between">
						<view class="item_info_le">车检时间</view>
						<view class="item_info_ri">2025.12.10</view>
					</view> -->
				</view>
				
				<view class="content_info">
					<view class="content_title flex align-center justify-between">
						<view class="title_le">图片信息</view>
						<view class="title_ri">
							<!-- <text>完善信息</text>
							<u-icon name="arrow-right" size="24"></u-icon> -->
						</view>
					</view>
					<view class="img_title">证件图片</view>
					<view class="img_list flex align-center justify-between">
						<view class="img_item" v-if="detailsInfo.xsz_url">
							<image :src='detailsInfo.xsz_url' mode="aspectFill" @tap.stop="previewImage(detailsInfo.xsz_url)"></image>
							<view class="img_tag flex align-center justify-center">行驶证图片</view>
						</view>
						<view class="img_item" v-if="detailsInfo.insure_url">
							<image :src='detailsInfo.insure_url' mode="aspectFill" @tap.stop="previewImage(detailsInfo.insure_url)"></image>
							<view class="img_tag flex align-center justify-center">保险图片</view>
						</view>
					</view>
					<!-- <view class="img_title">车辆图片</view>
					<view class="img_list">
						<view class="img_item">
							<image :src='STATIC_URL+"402.png"' mode="aspectFill"></image>
						</view>
					</view> -->
				</view>
				<!-- <view class="del_btn flex align-center justify-center">删除</view> -->
			</view>
		</template>
	</view>
</template>
<script>
	import UploadImage from '@/common/utils/upload-image.js'
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},

		data() {
			return {
				id: "",
				isShow: true,
				detailsInfo: {},
			};
		},
		computed: {
			
		},
		watch: {},
		onLoad(options) {
			let { id } = options;
			if (id !== undefined) this.id = id;
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.getCarDetail();
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			getCarDetail() {
				this.$api.get(global.apiUrls.postCarDetail, {
					id: this.id
				}).then(res => {
					console.log(res);
					this.isShow = false;
					if (res.data.code == 1) {
						this.detailsInfo = res.data.data;
					} else {
						this.$message.info(res.data.info);
					}
				})
			},
			// 预览图片
			previewImage(url) {
				let arr = [];
				arr.push(url);
				uni.previewImage({
					current: 0,
					urls: arr
				})
			},
			//拨打电话
			getgiveMobile() {
				let _this = this;
				uni.makePhoneCall({
					phoneNumber: _this.detailsInfo.insure_phone //仅为示例
				});
			},
		}
	};
</script>
<style lang="scss" scoped>
	.page_content {
		padding: 0 24rpx 16rpx;
		.content_info {
			background: #fff;
			border-radius: 16rpx;
			padding: 0 24rpx 16rpx;
			margin-top: 16rpx;
		}
		.del_btn {
			width: 100%;
			height: 96rpx;
			background: #FFFFFF;
			border-radius: 16rpx;
			font-weight: 500;
			font-size: 30rpx;
			color: #FF532E;
			margin: 16rpx 0 32rpx;
		}
		.content_title {
			padding: 30rpx 0 24rpx;
			border-bottom: 1px solid #eee;
			.title_le {
				font-weight: bold;
				font-size: 30rpx;
				color: #000000;
			}
			.title_ri {
				font-weight: 400;
				font-size: 28rpx;
				color: #1A66FA;
			}
		}
		.item_info {
			padding: 26rpx 0;
			border-bottom: 1px solid #eee;
			.item_info_le {
				font-weight: 400;
				font-size: 28rpx;
				color: rgba(0,0,0,0.6);
			}
			.item_info_ri {
				font-weight: 500;
				font-size: 28rpx;
				color: rgba(0,0,0,0.8);
			}
			image {
				width: 30rpx;
				height: 30rpx;
				margin-left: 16rpx;
			}
		}
		.img_title {
			font-weight: 400;
			font-size: 28rpx;
			color: #000000;
			padding: 18rpx 0;
		}
		.img_list {
			overflow: hidden;
			.img_item {
				width: 320rpx;
				height: 240rpx;
				margin-bottom: 16rpx;
				position: relative;
				image {
					width: 100%;
					height: 100%;
					border-radius: 16rpx;
				}
				.img_tag {
					width: 100%;
					height: 50rpx;
					border-radius: 0 0 16rpx 16rpx;
					position: absolute;
					left: 0;
					bottom: 0;
					background: rgba(0, 0, 0, 0.6);
					font-size: 24rpx;
					color: #fff;
				}
			}
			.img_item:nth-child(2n+2) {
				margin-right: 0;
			}
		}
		.no_line {
			border-bottom: 0;
		}
	}
	.personalInformation_picker2_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		background-size: 100% !important;
		padding: 0rpx 32rpx 0rpx 32rpx;
		border-radius: 16rpx 16rpx 0rpx 0rpx;
		background-size: 100% auto !important;
		height: 100rpx;
	}

	.personalInformation_picker2_0_c0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #BFBFBF;
	}

	.personalInformation_picker2_0_c1 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
	}

	.personalInformation_picker2_0_c2 {
		color: rgba(44, 143, 255, 1);
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
	}

	.personalInformation_fd1_0 {
		// margin-top: 32rpx;
		height: 96rpx;
		border-top: 1px solid #eee;
	}

	.personalInformation_fd1_0_c0 {
		font-weight: 400;
		font-size: 28rpx;
		color: rgba(0,0,0,0.6);
	}

	.personalInformation_fd1_0_c1_image {
		width: 72rpx;
		height: 72rpx;
		border-radius: 50%;
	}

	.personalInformation_fd1_1 {
		border-bottom: 1px solid #eee;
		height: 109rpx;
	}

	.personalInformation_fd1_1_c0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #333333;
	}

	.personalInformation_fd1_1_c1 {
		font-weight: 400;
		font-size: 28rpx;
		color: #222222;
		text-align: right;
		margin: 0rpx 0rpx 0rpx 24rpx;
	}

	.personalInformation_fd1_2 {
		border-bottom: 1px solid #eee;
		height: 109rpx;
	}

	.personalInformation_fd1_2_c0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #333333;
	}

	.personalInformation_fd1_2_c1 {
		font-size: 32rpx;
		font-weight: 400;
		color: #333;
		text-align: right;
		margin: 0rpx 0rpx 0rpx 24rpx;
	}

	.personalInformation_fd1_3 {
		border-bottom: 1px solid #eee;
		height: 109rpx;
	}

	.personalInformation_fd1_3_c0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #333333;
	}

	.personalInformation_fd1_3_c1 {
		font-weight: 500;
		font-size: 28rpx;
		color: rgba(0,0,0,0.8);
	}

	.personalInformation_flex_1 {
		background: #fff;
		border-radius: 16rpx;
		padding: 24rpx 24rpx 0rpx 24rpx;
		margin: 16rpx 24rpx 0;
	}

	.personalInformation_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.personalInformation_fd0_0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #111;
	}

	.personalInformation_fd0_0_c1 {
		font-size: 32rpx;
		font-weight: bold;
		color: #111111;
	}

	.personalInformation_fd0_0_c2 {
		width: 36rpx;
		height: 36rpx;
	}

	.personalInformation_flex_0 {
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background: url(https://speed.zhongchuxing.com/gjdimages/page_bg.png) no-repeat;
		background-size: 100% auto !important;
	}

	.page {
		min-height: calc(100vh - var(--window-bottom));
		background: url(https://speed.zhongchuxing.com/gjdimages/page_bg.png) no-repeat #f6f7fb;
		background-size: 100% auto !important;
	}
</style>